import { onMounted, onBeforeUnmount } from "vue";

export default function useMouse() {
  onMounted(() => {
    window.addEventListener("mousewheel", disableMouseScroll, {
      passive: false
    });

    document.addEventListener("contextmenu", contextmenu);
  });

  function disableMouseScroll(event: any) {
    event.preventDefault();
  }

  function contextmenu(event: any) {
    event.preventDefault();
  }

  onBeforeUnmount(() => {
    window.removeEventListener("mousewheel", disableMouseScroll);
    document.removeEventListener("contextmenu", contextmenu);
  });

  return;
}
